package org.whuims.leveltree.visual;

import java.util.Collection;

import org.whuims.leveltree.ParserWorker;

import com.chaoticity.dependensee.Main;

import edu.stanford.nlp.trees.GrammaticalStructure;
import edu.stanford.nlp.trees.GrammaticalStructureFactory;
import edu.stanford.nlp.trees.PennTreebankLanguagePack;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.trees.TreebankLanguagePack;

public class VisualTree {
	public static void main(String[] args) throws Exception {
		String text = "A quick brown fox jumped over the lazy dog.";
		Tree tree = ParserWorker.parseSingleLine(text);
		TreebankLanguagePack tlp = new PennTreebankLanguagePack();
		GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();
		GrammaticalStructure gs = gsf.newGrammaticalStructure(tree);
		Collection tdl = gs.typedDependenciesCCprocessed(true);
		Main.writeImage(tree, tdl, "d:/image.png", 3);
		new PhotoFrame("d:/image.png");
	}
}
